Skip to content

use checked casts and arithmetic in Miri engine#70226

Merged
bors merged 11 commits intorust-lang:masterfrom
RalfJung:checked
Mar 25, 2020
Merged

use checked casts and arithmetic in Miri engine#70226
bors merged 11 commits intorust-lang:masterfrom
RalfJung:checked

Conversation

@RalfJung
Copy link
Copy Markdown
Member

This is unfortunately pretty annoying because we have to cast back and forth between u64 and usize more often that should be necessary, and that cast is considered fallible.

For example, should this really be usize?

Also, LayoutDetails uses usize for field indices, but in Miri we use u64 to be able to also handle array indexing. Maybe methods like mplace_field should be suitably generalized to accept both u64 and usize?

r? @oli-obk Cc @eddyb

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants